import { S } from '../../s';
import { PSControlContainerImpl } from '../pscontrol-container-impl';
import { IPSTabExpPage } from './ipstab-exp-page';
import { IPSTabExpPanel } from './ipstab-exp-panel';

export class PSTabExpPanelImpl
  extends PSControlContainerImpl
  implements IPSTabExpPanel
{
  protected pstabexppages: IPSTabExpPage[];
  getPSTabExpPages(): IPSTabExpPage[] | null {
    return (
      this.pstabexppages ||
      (this.pstabexppages = this.fillChildListModel(
        this.M.getPSTabExpPages,
        S._269,
      ) as IPSTabExpPage[])
    );
  }

  findPSTabExpPage(objKey: any): IPSTabExpPage | null {
    return this.getPSModel5(
      S._269,
      this.getPSTabExpPages(),
      objKey,
    ) as IPSTabExpPage;
  }

  get tabLayout():
    | 'TOP'
    | 'TOP_EMBEDDED'
    | 'LEFT'
    | 'BOTTOM'
    | 'RIGHT'
    | 'FLOW'
    | 'FLOW_NOHEADER'
    | 'NOHAEDER'
    | 'USER'
    | 'USER2' {
    return this.M.tabLayout;
  }

  get uniqueTag(): string {
    return this.M.uniqueTag;
  }
  get cls(): string {
    return 'PSTabExpPanelImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._214 || cls == S._21b) return true;
    return super.instanceof(cls);
  }
}
